<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :deleteApiName="deleteApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :showAttrs="showAttrs"
    >
    </table-view>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  </div>
</template>

<script>
import AddOrUpdate from './trayleave-add-or-update'
import tableView from '@/components/tableView'
import basicMixins from '@/utils/commonViewMixins'

export default {
  mixins: [basicMixins],
  data() {
    return {
      searchAttrs: {
        trayInfoId: {
          type: 'autoComplete',
          placeholder:'托盘编号',
          querySearchApiName: 'trayApi/getTrayInfoList'
        },
        dateTimeRange:{
          type: 'date',
          dateType: 'daterange',
          clearable: true
        }
      },
      primaryKey: 'id',
      listApiName: 'trayApi/listTrayLeave',
      deleteApiName: 'trayApi/deleteTrayLeave',
      saveAuthName: 'tray:trayleave:save',
      deleteAuthName: 'tray:trayleave:delete',
      showAttrs: {
        trayInfoNo: {label: '托盘'},
        trayNumber: {label: '出库数量'},
        dayTime: {label: '日期', type: 'date'},
        createUser: {label: '创建人员'},
        createTime: {label: '创建时间', type: 'date'},
        status: {
          label: '状态',
          type: 'radio',
          items: [
            {value: 0, text: '禁用', tagType: 'danger'},
            {value: 1, text: '正常'}
          ]
        }
      }
    }
  },
  components: {
    AddOrUpdate,
    tableView
  }
}
</script>
